#ifndef _GAME_TIME_H
#define _GAME_TIME_H

#include "SFML\System.hpp"

class GameTime
{
public:
	static GameTime* getSingleton();
	static void cleanSingleton();

	void update();	// only update once every loop

	float getTotalTimeAsSeconds() const;
	sf::Int32 getTotalTimeAsMilliseconds() const;
	sf::Int64 getTotalTimeAsMicroseconds() const;
	float getElapsedTimeAsSeconds() const;
	sf::Int32 getElapsedTimeAsMilliseconds() const;
	sf::Int64 getElapsedTimeAsMicroseconds() const;
	float deltaTime() const;

private:
	GameTime(void);
	~GameTime(void);

	static GameTime* _instance;

	sf::Clock _elapsedTimeClock;
	sf::Clock _totalTimeClock;
	sf::Time _elapsedTime;
	sf::Time _totalTime;
	float _deltaTime;
};

#endif // _GAME_TIME_H

